<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // Promise.prototype.finally()用于指定不管promise对象最后的状态如何，都会执行的操作
        let p=new Promise(function(resolve,reject){
            // resolve();
            reject("哈哈哈");
        });
        p.then(function(data){
            console.log(data);
        }).catch(function(e){
            console.log(e);
        }).finally(function(){
            console.log("始终都会执行的代码");
        });
    </script>
</head>
<body>
    
</body>
</html>